package com.server.http.handler.impl;

import com.server.conditionenum.HttpReturnStatus;
import com.server.http.handler.HttpHandler;
import com.server.http.request.HttpRequestMessage;
import com.server.http.response.HttpResponseMessage;
import com.server.mine.net.HttpProtocol;

public class Client_BindUser extends HttpHandler{
	@Override
	public void handle(HttpRequestMessage request, HttpResponseMessage response) {
		/*String username = request.getParameter("uname");
		String password = request.getParameter("pword");
		long uid = 0;
		int failMsg = 0;
		if(username == null || username.equals("") || password == null || password.equals("")) {
			failMsg = 0;
		}else {
			try {
				uid = Long.parseLong(request.getParameter("uid"));
				if(DataBaseManager.GetInstance().JudgeUidBind(uid)) {
					if(DataBaseManager.GetInstance().JudgeUsername(username)) {
						if(DataBaseManager.GetInstance().BindUsername(username, password, uid)) {
							failMsg = 1;
						}else failMsg = -1;
					}else {
						failMsg = 3;
					}
				}else {
					failMsg = 2;
				}
			}catch(Exception e) {
				failMsg = 0;
			}
		}
		

		SetReturnData(response,failMsg,HttpProtocol.BINDUSER,HttpReturnStatus.Successed);*/
		SetReturnData(response,-1,HttpProtocol.BINDUSER,HttpReturnStatus.Failed);
	}
}
